package com.fy.order.api;

import com.fy.order.dto.FindOrderDto;
import com.fy.order.dto.TravelOrderDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;


@Primary
@FeignClient(value = "domain-order", path = "/travel/order")
public interface TravelOrderService {

    //添加travel_order门票订单信息
    @RequestMapping(value = "/addTravelOrder",method = RequestMethod.POST)
    TravelOrderDto addTravelOrder(TravelOrderDto travelOrderDto);

    //通过id查看travel_order订单
    @GetMapping(value = "/travelOrderFindById")
    TravelOrderDto travelOrderFindById(int travelOrderId);

    //查看全部travel_order订单
    @GetMapping(value = "/travelOrderFindAll")
    List<TravelOrderDto> travelOrderFindAll();

    //查询订单条件查
    @GetMapping(value = "/findTravelOrder")
    TravelOrderDto findTravelOrder(FindOrderDto findOrderDto);

    //修改travel_order订单信息
    @RequestMapping(value = "/updateTravelOrder",method = RequestMethod.POST)
    Boolean updateTravelOrder(@RequestBody TravelOrderDto travelOrderDto);

    //抢单
    @RequestMapping(value = "/grabTravelOrder",method = RequestMethod.POST)
    TravelOrderDto grabTravelOrder(int travelOrderId, int businessId);

    //修改travel_order订单状态
    @RequestMapping(value = "/updateTravelOrderState",method = RequestMethod.POST)
    TravelOrderDto updateTravelOrderState(int travelOrderId, int orderState);

    //删除travel_order订单
    @RequestMapping(value = "/deleteTravelOrderState",method = RequestMethod.POST)
    int deleteTravelOrderState(int travelOrderId);

    //支付
    @RequestMapping(value = "/payTravelOrderState",method = RequestMethod.POST)
    TravelOrderDto payTravelOrderState(int travelOrderId, int orderState);
}
